package command;

/**
 * 封装命令 实现 关闭电视机
 */
public class TVOffCommand implements Command {
    private TvReceiver receiver;

    public TVOffCommand(TvReceiver receiver) {
        this.receiver = receiver;
    }

    @Override
    public void execute() {
        receiver.off();
    }

    @Override
    public void undo() {
        receiver.on();
    }
}
